<?php
$this->breadcrumbs=array(
	Yii::t('application', 'Fdgroups')=>array('index'),
	Yii::t('application', 'Manage'),
);

$this->menu=array(
//	array('label'=>Yii::t('application', 'List Fdgroup'), 'url'=>array('index')),
	array('label'=>Yii::t('application', 'Create Fdgroup'), 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('fdgroup-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>


<?php echo CHtml::link('Advanced Search', '#', array('class' => 'search-button')); ?>
<div class="search-form" style="display:none">
    <?php
    $this->renderPartial('_search', array(
        'model' => $model,
    ));
    ?>
</div><!-- search-form -->

<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'fdgroup-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'columns' => array(
        'idfdgroup',
        'fdgroupname',
        'under',
        'idfdrules',
//		array(
//			'class'=>'CButtonColumn',
//		),
        array(
            'class' => 'CButtonColumn',
            'template' => '{ok}',
            'buttons' => array
                (
                'ok' => array
                    (
                    'label' => 'Select',
                    'imageUrl' => Yii::app()->request->baseUrl . '/images/dialog-ok.png',
                    'url' => 'Yii::app()->createUrl("users/email", array("id"=>$data->idfdgroup))',
                    'click' => 'js: function(){
                                        $("#' . $id . '").val($(this).parent().parent().children(\':first-child\').text());
                                        $("#' . $popupid . '").dialog("close");
                                        return false;
                                     }',
                ),
            ),
        ),
    ),
));
?>
